class Stranger:
    eyeNumer=2
    #构造函数
    def __init__(self,gender=None,age=None,job=None):
        self.gender=gender
        self.__age=age  #private
        self.jobb=job


    @property
    def age(self):
        return self.__age

    @age.setter
    def age(self, age):
        if isinstance(age, int):
            self.__age = age
        else:
            raise ValueError("int type needed")
if __name__ == '__main__':

    xiaomei = Stranger()
    xiaomei.gender="f"
    # xiaomei.setAge(18)
    xiaomei.age = 18
    xiaomei.jobb="teacher"
    # print(xiaomei.getAge())
    print(xiaomei.age)




    # print(xiaomei.gender)
    # print(xiaomei.age)
    # print(xiaomei.jobb)
